package com.wfm.leetcode.editor.cn;

import com.wfm.common.ListNode;

public class BM15删除有序链表中重复的元素I83 {
    public ListNode deleteDuplicates(ListNode head) {
        if(head==null) return null;
        ListNode cur = head;
        while (cur.next!=null){
            if(cur.val==cur.next.val){
                cur.next=cur.next.next;
            }else {
                cur=cur.next;
            }
        }
        return head;
    }
}
